package cn.lijiajia3515.cairo.auth.framework.security.oauth2.server.authorization.jackson2;

import cn.lijiajia3515.cairo.security.authentication.CairoAuthenticationToken;
import org.springframework.security.oauth2.core.AuthorizationGrantType;
import org.springframework.security.oauth2.core.OAuth2AuthorizationCode;
import org.springframework.security.oauth2.server.authorization.OAuth2Authorization;
import org.springframework.security.oauth2.server.authorization.jackson2.OAuth2AuthorizationServerJackson2Module;

public class CairoAuthorizationServerModule extends OAuth2AuthorizationServerJackson2Module {
	@Override
	public void setupModule(SetupContext context) {
		super.setupModule(context);
		context.setMixInAnnotations(AuthorizationGrantType.class, AuthorizationGrantTypeMixin.class);
		context.setMixInAnnotations(OAuth2Authorization.Token.class, OAuth2AuthorizationTokenMixin.class);
		context.setMixInAnnotations(OAuth2AuthorizationCode.class, OAuth2AuthorizationCodeMixin.class);

		context.setMixInAnnotations(CairoAuthenticationToken.class, CairoAuthenticationTokenMixin.class);
	}
}
